#ifndef Eratostenes_hpp
#define Eratostenes_hpp

class Eratostenes {
private:
protected:
	bool calculated;
	bool *sieve;
	unsigned sieveSz;
	unsigned n;
public:
	// All primes until 'n' will be calculated
	Eratostenes(unsigned n);
	
	// Destructor
	virtual ~Eratostenes();

	// Do the Eratostenes's algorithm 
	virtual void calculate(long long *icount = 0, unsigned nThreads = 1);

	// Eratostenes[number] returns true if the number is a prime one
	// or false otherwise
	bool operator[] (const unsigned number) const;
};

#endif
